import { Module } from '@nestjs/common';
import { ArticlesModule } from './articles/articles.module';
import { RouterModule } from '@nestjs/core';
import { ApiController } from './api.controller';
import { TagsModule } from './tags/tags.module';
import { ArticleTagModule } from './article-tag/article-tag.module';
import { FileManageModule } from './file-manage/file-manage.module';
import { CommentsModule } from './comments/comments.module';

@Module({
  imports: [
    ArticlesModule,
    TagsModule,
    ArticleTagModule,
    FileManageModule,
    CommentsModule,
    RouterModule.register([
      {
        path: 'api',
        module: ApiModule,
        children: [
          {
            path: 'articles',
            module: ArticlesModule,
          },
          {
            path: 'tags',
            module: TagsModule,
          },
          {
            path: 'article-tag',
            module: ArticleTagModule,
          },
          {
            path: 'file-manage',
            module: FileManageModule,
          },
          {
            path: 'comments',
            module: CommentsModule,
          },
        ],
      },
    ]),
  ],
  controllers: [ApiController],
})
export class ApiModule {}
